/**
 * 
 */
package com.gosophia.commons.exception;

import javax.xml.ws.WebFault;

/**
 * 功能：
 * 
 * @author zhangdongsheng
 * @since 2010-10-19 Copyright (c) 2010 Gosophia corporation All Rights Reserved
 */
@WebFault(name = "CommonException", faultBean = "CommonFaultBeanTest", targetNamespace = CustomerExceptionInfo.EXCEPTION_NAMESPACE)
public class CommonException extends RuntimeException {
    
    private static final long serialVersionUID = 1L;
    protected ExceptionDetail  faultInfo;
    
    public CommonException() {}

    public CommonException(String message, ExceptionDetail  faultInfo) {
        super(message);
        this.faultInfo = faultInfo;
    }
    public CommonException(String message,String errorCode,String[] values){
    	super(message);
    	this.faultInfo=new ExceptionDetail(errorCode,message,values);
    }
    
    public CommonException(String message, String errorCode) {
        super(message);
        this.faultInfo = new ExceptionDetail(errorCode, message);
    }

    public CommonException(String message, ExceptionDetail faultInfo, Throwable cause) {
        super(message, cause);
        this.faultInfo = faultInfo;
    }

    public ExceptionDetail getFaultInfo() {
        return faultInfo;
    }
 
    public String getErrorCode() {
        return getFaultInfo().getErrorCode();
    }
 
    public void setErrorCode(String errorCode) {
        getFaultInfo().setErrorCode(errorCode);
    }
}
